package com.pactera.integral.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CORSConfig extends WebMvcConfigurerAdapter {
	
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowCredentials(true)
                .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
                .exposedHeaders("X_Auth_Token,Content-Range,X-Content-Range")
                .allowedHeaders("Origin,Accept,Filter,Content-Range,X-Content-Range,Range,X-Range,x-requested-with,content-type,Access-Token,Authentication,Authorization");
    }

}
